<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // console.log(Object);
        // console.log(Array);

        let obj = {
            name:"老王"
        }

        let a = 12;
        let b =5;

        let fn = function(){
            console.log(this.a);
        }

        // let obj2 = {
        //     a:a,
        //     b:b,
        //     obj:obj
        // }

        // 对象简写
        let obj2 = {
            a,
            b,
            obj,
            fn,
            // fn2:function(){
            //     console.log(this.b);
            // }
            fn2(){
                console.log(this.obj);
            }
        }
        console.log(obj2);
        obj2.fn();
        obj2.fn2();

    </script>
</body>
</html>